Object recognition with reduced neural network weight precision

ABSTRACT

A client device configured with a neural network includes a processor, a memory, a user interface, a communications interface, a power supply and an input device, wherein the memory includes a trained neural network received from a server system that has trained and configured the neural network for the client device. A server system and a method of training a neural network are disclosed.

CROSS REFERENCE TO RELATED PATENT APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.16/553,158, filed Aug. 27, 2019, which is a continuation of U.S. patentapplication Ser. No. 14/663,233, filed Mar. 19, 2015, now U.S. Pat. No.10,417,525, issued Sep. 17, 2019, which claims priority from U.S.Provisional Patent Application Ser. No. 62/053,692, filed Sep. 22, 2014,the disclosures of which are hereby incorporated by reference.

BACKGROUND

Increasingly, machines (i.e., computers) are used to provide machinevision or object recognition. Object recognition provides users with avariety of beneficial tools.

In some instances, object recognition relies upon algorithms thatinclude a neural network. That is, a device may recognize that an objectis within an input image by using a neural network. Generally, theneural network has been trained to recognize objects through prior useof training images. This object recognition process can become morediscerning if more training images are used for the object.

Generally, neural networks include systems of interconnected “neurons.”The neural networks compute values from inputs and are capable ofmachine learning as well as pattern recognition as a result of theiradaptive nature.

Neural networks for image recognition require data processes forlearning and for recognition that are memory and processing intensive,and therefore computationally expensive. Indeed, the values of theweights require memory space for storage and for processing duringcomputational processes.

As might be expected, increasing the size of a training data setimproves the performance of a neural network. Unfortunately, in a mobiledevice such as a smartphone, memory and processing capabilities arecomparatively limited. Accordingly, the increasingly pervasive use ofmobile devices generally has not benefitted from image recognitiontechnology.

What are needed are methods and apparatus to provide for improvedperformance of a neural network on a computing device that has limitedresources.

BRIEF SUMMARY

The present description gives instances of server systems for imagerecognition training that may generate configuration information forneural networks, client devices for performing image recognition usingneural networks that work based on downloaded neural networkconfiguration information, and methods, the use of which may helpovercome problems and limitations of the prior art.

In one embodiment, a client device is configured with a neural network.The client device includes a processor, a memory, a user interface, acommunications interface, a power supply and an input device, whereinthe memory includes a trained neural network received from a serversystem that has trained and configured the neural network for the clientdevice.

The input device may be configured to capture an image and to storeimage input data in the memory. The client device may further include amultilayer perceptron (MLP) classifier configured to map image inputdata. The neural network may include a convolutional neural network. Theneural network may be configured to generate a feature map; the featuremap may include a plurality of weight values derived from an inputimage; the neural network may be configured to perform a quantizationoperation on the feature map; the quantization operation may include oneof unitary quantization, adaptive quantization, uniform quantization,and supervised iterative quantization; the quantization may performback-propagation (BP) of image input data. The neural network may beconfigured to perform object recognition. The neural network may provideoutput of a recognition operation. The client device may include one ofa smartphone, a tablet computer and a portable electronic device.

In another embodiment, a system for providing object recognition with aclient device is provided. The system includes a server systemconfigured for training a neural network to perform object recognitionand exporting the neural network to the client device.

The system may further include the client device comprising a processor,a memory, a user interface, a communications interface, a power supplyand an input device; and, the memory comprising the trained neuralnetwork received from the server system. The server system may include adatabase of training images. The neural network may include aconvolutional neural network; the convolutional neural network mayinclude at least two layers; the convolutional neural network mayinclude a convolutional layer and a subsampling layer; the server systemmay include a multilayer perceptron (MLP) classifier. The server systemmay be configured to employ a learning technique for the training; andthe learning technique may include one of a back-propagation (BP),Restricted Boltzmann Machine, and Auto Encoder Decode technique.

In another embodiment, a server system is provided. The server systemincludes an input device configured to receive a training image; aneural network that includes at least two layer pairs, each layer pairincluding a convolutional layer and a subsampling layer; a multilayerperceptron (MLP) classifier; wherein the neural network is configured toperform quantization of interim weights in the convolutional layers, andthe neural network is also configured to generate in the subsamplinglayer an interim feature map in response to an input applied to theconvolutional layer; and the neural network configured to performquantization of weights in the MLP classifier, and the neural network isconfigured to generate in the MLP classifier a classification output inresponse to the feature map being applied to quantized weights MLP.

In another embodiment, a method for training a neural network configuredfor object recognition using a client device, the method may includereceiving an input image with the neural network; performing a trainingpass through the neural network, the training pass including aquantization operation; configuring the neural network with weightvalues from the quantization operation; configuring the neural networkfor use by the client device; and, at least one of storing the neuralnetwork in a server system and exporting the neural network to theclient device.

In yet another embodiment, a computer program product stored onnon-transitory machine readable media is included. The computer programproduct may include machine executable instructions for training aneural network configured for object recognition using a client device,by executing a method that includes: receiving an input image with theneural network; performing a training pass through the neural network,the training pass including a quantization operation; configuring theneural network with weight values from the quantization operation;configuring the neural network for use by the client device; and, atleast one of storing the neural network in a server system and exportingthe neural network to the client device.

Advantages over the prior art include cost savings for client devicesmade according to embodiments, with acceptable or even no degradation ofperformance. Indeed, the memory requirement may be lower for storage andalso processing to recognize objects, which results in lower arearequirements, lower power consumption, and thus lower cost.

These advantages can be important for mobile devices. Indeed, suchdevices may be able to perform on-chip image recognition in real-time,which can be useful in mobile applications such as context awareness.

BRIEF DESCRIPTION OF THE DRAWINGS

The features and advantages of the invention are apparent from thefollowing description taken in conjunction with the accompanyingdrawings in which:

FIG. 1 is a composite diagram of block diagrams of a sample serversystem and a sample client device according to embodiments, flowchartsaccording to embodiments, and other interrelated aspects.

FIG. 2 is a composite diagram of a sample block diagram of a neuralnetwork of either the server or the client of FIG. 1 , and furtherillustrating possible operations according to embodiments.

FIG. 3 is a diagram illustrating a sample pair of a convolutional layerand a subsampling layer for explaining operations of components of FIG.2 according to embodiments.

FIG. 4 is a flowchart illustrating a neural network training process ina training flowchart of FIG. 1 , according to embodiments.

FIG. 5 is a sample block diagram of a neural network for a serversystem, which further illustrates where a quantization operation of theflowchart of FIG. 4 can be applied according to embodiments.

FIG. 6 is a sample equation expression that may be used in aone-dimensional adaptive quantization operation.

FIG. 7 is a sample diagram for illustrating a one-dimensional example ofan adaptive quantization operation resulting by applying the equationexpression of FIG. 6 .

FIG. 8 is a sample diagram for illustrating a two-dimensional example ofan adaptive quantization operation embodiment that can be used in theflowchart of FIG. 4 .

FIG. 9 shows sample equation expressions for performing embodiments ofadaptive quantization operations.

FIG. 10 is a sample equation that may be used to determined quantizedvalues in a one-dimensional uniform quantization operation.

FIG. 11 is a sample diagram for illustrating a one-dimensional exampleof a uniform quantization operation resulting by applying a version ofthe equation expression of FIG. 10 .

FIG. 12 is a sample block diagram of a neural network for a clientdevice, which further illustrates where a quantization operation can beapplied according to embodiments.

FIG. 13 is a group of sample training images for handwriting recognitionused for performing simulations.

FIG. 14 is a conceptual diagram of sample data structures in a sampleconvolutional neural network used for performing simulations.

FIG. 15 is a table showing simulation results that contrast thesimulated performance of embodiments over the prior art.

FIG. 16 is a bar chart for contrasting simulated performance ofembodiments over the prior art.

FIG. 17 is another bar chart for contrasting simulated performance ofembodiments over the prior art.

FIG. 18 shows groups of bar charts for contrasting simulated performanceof embodiments over the prior art.

DETAILED DESCRIPTION

Disclosed herein are methods and apparatus that provide for efficientoperation of a neural network on a client that has limited resources.Generally, the methods and apparatus provide for building aconvolutional neural network (CNN) on a device that has substantialcomputing resources (such as a server) using a computationally intensivelearning process. Once built, the neural network may be ported to aclient device that has comparatively limited computing resources (suchas a smartphone).

Neural networks are useful for a variety of computationally complicatedtasks. For example, a neural network may be useful for objectrecognition. Object recognition may provide for facial recognition,environmental surveillance, to control production and manufacturing, toassist with medical diagnostics, and a variety of other similarprocesses.

Types of neural networks include those with only one or two layers ofsingle direction logic, to complicated multi-input many directionalfeedback loops and layers. Generally, these systems use algorithms intheir programming to determine control and organization of theirfunctions. Most systems use “weights” (which can be expressed as values)to change the parameters of the throughput and the varying connectionsto the neurons. Neural networks can be autonomous and learn from priortraining accomplished through use of sets of training data.

In order to provide some context for the teachings herein, some aspectsare now introduced.

As discussed herein, the term “server” generally refers to a computingresource that has robust computational resources. Exemplary resourcesinclude those important for performing tasks described herein, and mayinclude substantial memory, processing capabilities, data storage andthe like. In exemplary embodiments, the server includes a conventionalserver (such as a blade server) a mainframe, a network of personalcomputers, or simply a personal computer (PC).

As discussed herein, the term “client” generally refers to a computingresource that has a reduced set of computational resources. Exemplaryresources include those important for performing tasks described herein,and may include a minimal amount of memory, processing capabilities,data storage and the like. In some embodiments, the client includesimaging capabilities to provide for collection of input images that areinput into the neural network.

As discussed herein, the term “neural network” generally refers tostatistical learning algorithms having an adaptive nature and istherefore useful in machine learning. The neural network may include aplurality of artificial nodes, known as “neurons,” “processingelements,” “units,” or by other similar terms and which are connectedtogether to form a network which mimics a biological neural network.Generally, a neural network includes sets of adaptive weights (i.e.numerical parameters that are tuned by a learning algorithm), and arecapable of approximating non-linear functions of their inputs. Theadaptive weights are conceptually connection strengths between neurons,which are activated during training and prediction. Generally, a neuralnetwork operates on a principle of non-linear, distributed, parallel andlocal processing and adaptation.

As discussed herein, the term “multilayer perceptron (MLP)” generallyrefers to a feedforward artificial neural network that maps sets ofinput data onto a set of appropriate outputs. Accordingly, an MLPclassifier may perform the recognition from the output of a neuralnetwork. An MLP may include a sequence of layers of nodes in a directedgraph, with each layer connected to the next. Except for the inputnodes, each node is a neuron (or processing element) that can have anonlinear activation function.

In general, “convolution” is a mathematical operation on two functions,f and g, producing a third function that may be viewed as a modifiedversion of one of the original functions, giving the area overlapbetween the two functions as a function of the amount that one of theoriginal functions is translated.

In general, the term “convolutional neural network” is a type offeed-forward artificial neural network where the individual neurons aretiled in such a way that they respond to overlapping regions in thevisual field. Convolutional networks are variations of multilayerperceptrons (MLP) and are designed to use minimal amounts ofpreprocessing. When used for image recognition, a convolutional neuralnetwork uses multiple layers of small neuron collections which look atsmall portions of the input image, called “receptive fields.” Theresults of these collections are then tiled so that they overlap toobtain a better representation of the original image. This is repeatedfor every such layer. Advantageously, a convolutional neural network mayuse shared weight in convolutional layers. Thus, the same filter(weights bank) is used for each pixel in the respective layer. This bothreduces required memory size and improves performance.

As discussed herein, the term “image” refers to a two-dimensional arrayof digitized image data, however, this is merely illustrative and is notlimiting. As discussed herein, images provided to the server may becollected by another device such as a camera (not shown) and preparedfor training by intermediate tools (such as software) and configured tomimic the form of images provided by the client (for example). Imagescollected by the client may be provided in a digitized form (such asfrom a camera in a smartphone). In exemplary embodiments, aspects suchas dimensions and number of pixels of training images are generallyequivalent to the dimensions and number of pixels of production images.Further, merely for purposes of distinguishing training images fromother images collected during operation of the client, images used fortraining the server are referred to as “training images.” Imagescollected by the client are referred to as “production images” and byother similarly distinct terms.

As discussed herein, an “object” may appear in or be contained within animage. For example, a car (object) may appear within a picture (image)of a landscape (collection of objects).

As discussed herein, the terms “program,” “software,” “application,”“add-in,” and other similar terms refer to machine executableinstructions stored on non-transitory machine readable media. Themachine executable instructions provide for execution of a methodthrough control of computing resources and any associated componentsdeemed appropriate.

In the exemplary embodiments, the methods and apparatus are useful forperforming object recognition from image data. The exemplary embodimentsare to be considered as merely illustrative and are not limiting of theteachings herein. Accordingly, the methods and apparatus disclosed maybe used equally well for other applications.

FIG. 1 depicts aspects of a server system 110 (also referred to as theserver 110) and a client device 310 (also referred to as the client310). An abbreviated flowchart is associated with each of the server 110and the client 310. A first flowchart 140 depicts aspects of trainingthe neural network 123 as performed by the server 110. A secondflowchart 340 depicts aspects of recognizing an image as performed bythe client 310.

FIG. 1 shows aspects of an exemplary server system 110. Flowchart 140introduces exemplary operations for the server system 110. Trainingimage 102 may optionally be stored in a training database 104. Briefly,server system 110 can be trained using training image 102, from whichserver system 110 can generate a configuration of learned weights.Training is discussed in greater detail further herein.

Server system 110 includes an input device 105 that is configured toreceive training image 102, such as from training database 104. Inputdevice 105 may include a digitizer, such as a scanner, or anothersimilar device. Input device 105 may be implemented in many similarother ways.

Server system 110 also includes a multilayer perceptron (MLP) classifier137. Neural network (NN) 123 and MLP classifier 137 may use a supervisedlearning technique such as “Back-Propagation (BP)” for training theneural network (NN) 123. In some embodiments, MLP classifier 137 is amodification of a standard linear perceptron, and may even distinguishdata that are not linearly separable. Being a neural network, MPLclassifier 137 could be considered part of neural network (NN) 123.Accordingly, neural network (NN) 123 and MLP classifier 137 are showngrouped together in FIG. 1 .

Server system 110 also includes a memory 130 that can store a program132. Server system 110 additionally includes a processor 120 and theneural network (NN) 123. Data 135 may be stored in memory 130 and may bestored in the neural network (NN) 123.

FIG. 1 additionally shows aspects of a sample client device 310.Associated with the client device is flowchart 340 that introducesexemplary operations for the client device 310. Briefly, client device310 can receive according to export operation 244. The export operation244 provides the configuration of learned weights that were generated byserver system 110. Accordingly, client device 310 may be able torecognize training image 102 in input image 302 once properlyconfigured.

Client device 310 includes an input device 305 that is configured toreceive input image 302, for performing image recognition. Client device310 also includes a memory 330 that can store a program 332, a processor320 and a neural network (NN) 323. Data 335 may be stored in memory 330and also in neural network (NN) 323.

Client device 310 may also include a multilayer perceptron (MLP)classifier 337. MLP classifier 337 may perform the recognition from theoutput of neural network (NN) 323. As discussed above, an MLP mayinclude a sequence of layers of nodes in a directed graph, with eachlayer connected to the next. Except for the input nodes, each node is aneuron (or processing element) that can have a nonlinear activationfunction. Neural network (NN) 323 and MLP classifier 337 may use asupervised learning technique called Back-Propagation (BP) for trainingthe network. Being a neural network, MLP classifier 337 could beconsidered part of neural network (NN) 323, or as a separate module. Inthe embodiments presented herein, the MLP classifier 337 is presented asa separate module so that commonalities between neural network (NN) 323and neural network (NN) 123 can be better described.

Some similarities are shown in the block diagrams of server system 110and client device 310. Notwithstanding these similarities, some offunctions and requirements may be very different. For example, serversystem 110 is not necessarily portable. More specifically, server system110 may have a large memory 130 and substantial processing 120 used togenerate configurations. Client device 310 may be presented in a varietyof forms, some of which may be portable or not. The client device 310may be a portable personal electronic device, and it may further includea touchscreen. Examples of the client device 310 include a smartphone(such as an iPhone from Apple Corporation of Cupertino, Calif., or adevice implementing the Android operating system from Google Corporationof Mountain View, Calif.), a tablet computer or other similar device.

Neural networks (NN) 123 and 323 include artificial intelligence (AI)technology, and can be used for learning and recognition, respectively.This description proceeds mostly in terms of neural networks (NN) 123and 323 being convolutional neural networks, but other types of neuralnetworks may be used.

In some embodiments of neural networks (NN) 123 and 323, a single layeris used. The single layer which may contain a number of neurons. Eachneuron may be considered to be a processing unit. Each neuron mayperform a transformation, such as a non-linear transformation. There canbe weighted connections among neurons within the layer. The weightedconnections may be stored as the weight values in memories of the neuralnetwork. A learning algorithm may be configured for learning the weightvalues.

In some embodiments, deep learning may be used. Deep learning involves ahierarchical architecture composed of multiple layers, similar to theforegoing layers. In addition, the weighted connections are amongneurons within a layer and also across the multiple layers. Deeplearning thus requires a substantial amount of memory 130. Examples ofdeep learning include back-propagation (BP), Restricted BoltzmannMachine, Auto Encoder Decode, etc. An example of a deep learningarchitecture for a neural network (NN) is now described.

FIG. 2 is a block diagram depicting exemplary aspects of neural network(NN) 423. Neural network (NN) 423 is an example of the above-describedneural network (NN) 123, neural network (NN) 323, or both.

In the example of FIG. 2 , neural network (NN) 423 includes at least afirst layer pair 421 of a first convolutional (C1) layer 454 and a firstsubsampling (S1) layer 458. Neural network (NN) 423 also includes asecond layer pair 422 of a second convolutional (C2) layer 464 and asecond subsampling (S2) layer 468. Pair 421 may be similar to pair 422,although that is not required. In some embodiments, pair 421 and pair422 have different numbers of feature maps.

An image 402 may be received by neural network (NN) 423, and moreparticularly by first convolutional layer 454. Neural network (NN) 423may thus generate a result 474 due to receiving image 402. Result 474 isan output generated in second subsampling layer 468, after anyiterations have been completed. In training mode, image 402 is atraining image and result 474 may be the generated learned weights forrecognizing image 402 in other input images. In object recognition mode,image 402 is an input image and result 474 may be used by MLP classifier337 to indicate a specific object recognized within input image 402.Layer pairs 421, 422 are now described in more detail with regard toFIG. 3 .

FIG. 3 is a diagram illustrating a sample layer pair 521 of aconvolutional layer 554 and a subsampling layer 558. Layer 554 andsubsampling layer 558 of pair 521 are examples of embodiments of thelayers of pair 421, 422, or both 421 and 422. These are explained interms of receiving an image 502 which, for this example, may containweight kernels 511, 512.

Convolutional layer 554 may contain feature maps 531, 532, by storingtheir respective weights. In practice, there can be many more than twofeature maps, but only two are shown in this diagram for simplicity.While in a training operation, each of these feature maps in layer 554can be the convolved operation result generated by convolving weightkernels 511, 512 with local weight kernels. While in object recognitionoperation, each of these feature maps in layer 554 can be convolved withthe input image to generate possible recognition of the object thatgenerated the feature map.

In addition, subsampling layer 558 may contain the same number offeature maps as the convolutional layer 554. In this case, subsamplinglayer 558 contains a first feature map 551 and a second feature map 552.Each of the feature maps (551, 552) in layer 558 can be the result ofsubsampling feature maps of the convolutional layer 554. Subsamplingreduces the dimension of the featured map in a structured way.Subsampling may be maximum or average subsampling over neurons withinthe feature maps or across different feature maps.

Feature maps 531, 532, 551, 552 are genuine feature maps. In someinstances within this disclosure, they may be referred to as “interim”feature maps, however, because they may be further processed by anotherlayer to generate an updated version of the feature map.

Returning now to FIG. 1 , aspects of exemplary server-to-devicesolutions are described for server system 110 and client device 310.These solutions involve performing the training/learning process on theserver system 110, and then exporting the learned configuration (i.e.,network weights) for the neural network (NN) 123 to the client device310. The exporting is shown in FIG. 1 as export operation 244. Exportingoperation 244 provides configuration information for the neural network(NN) 123 to the client device 310. Until the configuration informationis exported, the configuration information may reside in a memory, forexample, as additional data 135 in memory 130, data storage (not shown)or another suitable repository. The configuration information may beexported to a variety of client devices such as the client device 310shown in FIG. 1 . Client device 310 can be a mobile device that receivesor imports the neural network configuration.

It will be appreciated that in some embodiments, at least a portion ofthe storage and computational resources used by client device 310 may beremote, such as on-board server system 110. Server system 110 thattrains a neural network can be located in the “cloud” (that is, at leasta portion of the server system 110 is implemented remotely from theclient device 310). In some embodiments, the server system 110 may beprovided by a public or non-dedicated service. In some embodiments, aclient device 310 may be configured such that performance of objectrecognition with the client device 310 is substantially equivalent toobject recognition performed by the server system 110. That is, in someembodiments, the client device 310 is configured with adequate traininginformation such that object recognition for more training images may beperformed without substantially degraded performance. Comparativeperformance may be measured real time, which can be useful for mobiledevices.

In some embodiments, computational requirements for client device 310may be reduced. For example, in some embodiments, a lesser bitresolution may be adequate for storing and processing the networkweights. Original double precession may not be needed. Such economiesmay enable the neural network 323 to operate with low-precisioncalculations. In some embodiments, it is possible to use analog memory.

Exemplary training processes are now described using flowchart 140 ofFIG. 1 . These training processes may be used for server system 110 orother systems. The processes of flowchart 140 will be described in termsof components of server system 110 as an example only.

According to an optional operation 141, all or parts of neural network123 can be initialized prior to use of training image 102. Inembodiments that use a layer pair, such as that of FIG. 3 , the firstconvolutional layer can be initialized prior to the training image beingapplied. This initializing can be, for example, with random weights oranother non-image specific configuration.

According to another operation 142, a training image can be received,for example via input device 105. In the example of FIG. 1 , thereceived training image is image 102, perhaps from training imagedatabase 104. Operation 140 may be repeated many times for training fordifferent images. Operation 140 may be repeated many times for trainingall the images within the training image database 104.

According to another operation 143, neural network (NN) 123 can betrained in ways that will be described shortly. According to anotheroperation 144, a configuration of neural network (NN) 123 that isgenerated after operation 143 can be exported. Operation 144 may beperformed in a manner that is substantially similar to, or the same as,the previously described export operation 244.

FIG. 4 describes exemplary embodiments of the training of operation 143with greater detail. The embodiments presented describe learning weightswith reduced bit resolution in more detail. Some of these embodimentsare referred to as “Supervised Iterative Quantization (S.I.Q.).”

In FIG. 4 , an exemplary method of training 643 is shown. Morespecifically, FIG. 4 depicts exemplary aspects for training the neuralnetwork to generate weights with reduced bit resolution. The result ofthe method of training 643 is quantized weights, which are exported tothe client device 310 for recognition. The reduction of bit resolutionfor input and feature maps is not mandatory in training.

In this example, the method of training 643 includes a training passoperation 610, according to which a training pass is performed throughlayer pairs for neural network (NN) 123. The training pass operation 610includes quantization operation 620, according to which quantization isperformed at one or more junctures. Accordingly, quantization operation620 modifies the training pass operation 610 in ways that will beexplained shortly.

According to another, optional operation 630, an inquiry is made as towhether a maximum iteration number has been reached. If the answer is“yes,” then execution of the method of training 643 is ended. If theanswer is “No,” then according to initialization operation 640, all orpart of the neural network (NN) 123 may be initialized again. Oncere-initialized, the neural network (NN) 123 may apply a version ofweights quantized from the quantization operation 620.

After the initialization operation 640, execution can return to thetraining pass operation 610, and so on. The iteration of the exemplarymethod of training 643 can be performed a few times.

The training pass operation 610 and the quantization operation 620embedded therein are now described in more detail. The descriptionrelates in particular to embodiments of the server system 110 that use aneural network (NN) with layer pairs such as those presented in FIG. 2 .

FIG. 5 is a block diagram depicting aspects of the quantizationoperation 620 for an exemplary neural network (NN) 723 of an embodimentof the server system 110. In this example, the neural network (NN) 723is similar to the above-described neural network (NN) 123.

Referring to FIG. 5 , in an exemplary quantization operation 720, theneural network (NN) 723 receives a training image 702, and generates aresult 774. The result 774 stands for generated learned weights that canbe used later for recognizing whether training image 702 contains acertain object whose label is defined in the training process. Theneural network (NN) 723 includes at least a first layer pair 721 of afirst convolutional (C1) layer 754 and a first subsampling (S1) layer758. Neural network (NN) 723 also includes a second layer pair 722 of asecond convolutional (C2) layer 764 and a second subsampling (S2) layer768. Layer pairs 721, 722 may be made as described above.

In FIG. 5 , arrows show the effect of the training pass operation 610and the quantization operation 620. In embodiments, the neural network(NN) 723 is first initialized with random weights or another non-imagespecific configuration. Training image 702, which has been received bythe input device, is applied to first convolutional layer 754. Asmentioned above, first convolutional layer 754 may have been initializedprior to training image 702 being applied to it.

Neural network (NN) 723 can be configured to generate in firstsubsampling layer 758 a first interim feature map, in response totraining image 702 being applied to first convolutional layer 754. Thisfirst interim feature map could be generated based on first interimoriginal weights.

As part of this training pass, the first interim feature map can beapplied to second convolutional layer 764. The neural network (NN) 723can be configured to generate in second subsampling layer 768 a secondinterim feature map, in response to the first interim feature map beingapplied to second convolutional layer 764. This second interim featuremap could have second interim original weights.

The resulting feature maps 768 can be used to make a predictionregarding what object mostly likely appears in the image using MLPclassifier 137. Based on the error of the prediction and ground truth,back propagation (BP) can be used to adjust (i.e., learn/train) theweights.

The training process may be repeated for all or part of training imagesin the training database. After that, the learned weights may bequantized using adaptive quantization method based on k-means (whichwill be described in detail later). Quantization reduces the number ofbits of the weights, while still preserving enough of the original data.In this particular case, quantization thus converts the original weightsinto lower-resolution weights.

In some embodiments, the process of training weights and thereafterquantization is considered as one training epoch.

If training epochs are smaller than a threshold (e.g., the answer atoperation 630 is “No”), the training pass operation 610 may be repeated.In such cases, the neural network (NN) 723 may be initialized usingquantized weights. Based on the initialization, the neural network (NN)723 may receive all or part of training images again, useback-propagation (BP) to learn the weights, and then quantize thelearned weights.

If training epochs are equal to or larger than a threshold (i.e., theanswer at operation 630 is “Yes”), the quantized weights may then beexported.

The process of Supervised Iterative Quantization (S.I.Q) (as outlined inregard to the exemplary process of FIG. 5 ), involves back-propagation(BP) of training images, adaptive quantization and iteration.

In exemplary embodiments, the input can be optionally quantized at thelocation shown by an arrow of an operation 626; the first interimfeature map can be optionally quantized at the location shown by anarrow of an operation 621; the second interim feature map can then beoptionally quantized at the location shown by an arrow of an operation627. In addition, the first convolutional layer can be configured tobecome initialized with a version of the second interim feature map,which was generated at the first training pass. The neural network canbe further configured to generate in the first subsampling layer anupdated first interim feature map, in response to the received trainingimage being applied again to the first convolutional layer. Theprocessor can be further configured to perform quantization of theupdated first interim feature map, so as to generate an updatedquantized first interim feature map that is configured to be applied tothe second convolutional layer. The neural network can be configured togenerate in the second subsampling layer an updated second interimfeature map, in response to the updated quantized first interim featuremap being applied to the second convolutional layer.

Quantization is now described in more detail. Quantization is a methodfor reducing a number of bits of a vector or a matrix, while stilltrying to preserve some of its properties. In this particular case, thevector or the matrix can be connected weights, an input image or afeature map. The reduced number of bits may reduce computationalcomplexity. In quantization methods, a data distribution of originalweight values is analyzed, and quantized weight values are generatedthat are used instead of the original weight values. Economies arise incomputations where groups of these quantized weight values are similarto each other.

In exemplary embodiments, adaptive quantization is a quantization methodwhere quantized weight values are computed from the original weightvalues. Examples are now described.

In one dimension, quantized weight values may be sought that minimizeequation expressions, such as the equation expression of FIG. 6 . FIG. 6does not show exactly an equation, but an equation expression whosevalue is to be minimized.

A one-dimensional example of quantization is shown in FIG. 7 , where adistribution of original weight values (w) between 0 and 1 is shown inthe horizontal axis. These original weight values (w), form clustersamong themselves, and thus quantized weight values (Q) are computed as0.262, 0.428, 0.603 and 0.866. The economy is achieved because theweight value (w) distribution is started with 25-30 original weightswhose values are different, and is replaced by quantized weights values(Q) whose values are similar in groups.

A two-dimensional example of quantization is shown in FIG. 8 . A featuremap 831A may have values represented by dots in two-dimensions. A numberK for the quantization may be set, which in this case can be 3 (K=3) forthe three main clusters of dots in feature map 831A. The quantizedfeature map 831B may be generated by operation 820, whose values wouldbe represented by the three stars, one near the center of each cluster.The values of the stars can be found in a number of ways. For example,the stars may start at some Initial places, and then iterate (assigneach original value to the nearest quantized value, then move the“quantized value” to the center of its cluster, etc.).

FIG. 9 shows sample equation expressions 9A, 9B, 9C that are to beminimized. Expression 9A is similar to that of FIG. 6 for adaptivequantization, except that Expression 9A also includes the subscript of1, where 1=1, 2 for the two layer pairs. Expression 9B can be used forflowchart 643, where F₁ denotes the combined operation of the coupledconvolution and subsampling layers Cl and Sl (1=1, 2). Expression 9C canbe equivalent to expression 9B. The problem can be solved viaalternating searching: Fix (w), and solve for (Q); fix (Q) and solve for(w).

From the above, it can be seen that adaptive quantization can becomputationally expensive, since new quantized weight values arecomputed from the original weight values. It is even more expensive whenthe computations require iterative search. As such, adaptivequantization is not indicated for on-chip implementation in a clientdevice with limited resources. This, however, is not as much a problemfor a server system with substantial resources.

Another type of quantization method is called “uniform quantization.”Uniform quantization selects quantized values by typically a simplerule, and then determines how many of the original values fit each ofthe quantized values. Accordingly, uniform quantization is lesscomputationally intensive than adaptive quantization, but the resultsare not as accurate. A one-dimensional example is now described.

FIG. 10 shows an equation that may be used to determine quantized valuesQ. The variable delta (Δ) may be set as needed.

FIG. 11 is a sample diagram for illustrating an application of theequation of FIG. 10 . In this example, the value of delta (Δ) is set at4, which will yield 4 quantized values. These quantized values are thusdetermined to be 0.125, 0.375, 0.625 and 0.875, regardless of thedistribution of the weight values in the horizontal axis.

In FIG. 11 , a distribution of original weight values (w) between 0 and1 is shown in the horizontal axis. (In fact, this distribution isidentical to that of FIG. 7 .) However, in FIG. 7 the results aredifferent, because the quantization method is different.

Returning again to FIG. 1 , client device 310 according to embodimentsmay receive the transferred learned configuration for the neural network(NN) 123 (i.e., network weights), for example according to exportoperation 244. This configuration will have been prepared in view oftraining image 102, and many other training images in database 104.

Processes for recognizing images according to exemplary embodiments arenow described using flowchart 340 (also of FIG. 1 ). These processes canbe for client device 310 or other configurations of client devices. Theprocesses of flowchart 340 will be described in terms of components ofclient device 310 as an example only.

According to an optional import operation 344, the configuration of theneural network (NN) 123 is imported. Import operation 344 may performsubstantially as the previously described operation 244. Importing canbe performed in a number of ways, for example by downloading over anetwork, loading from a memory device, and so on. The configuration ofthe neural network (NN) 123 may be imported, for example, to neuralnetwork (NN) 323 and to MLP classifier 337. In other instances, theconfiguration of the neural network (NN) 123 may be stored in memory 330as additional data 335 at an appropriate time, such as that ofmanufacture.

According to an input operation 345, an input image may be received andinput. This may be performed in a number of ways, for example via inputdevice 305 being configured to receive input image 302.

According to a first generation operation 346, a first interim featuremap may be generated. This may be performed in a number of ways, forexample by applying the input image to a first convolutional layer, aswill be explained in more detail later. Optionally, quantization of thereceived input image may be performed prior to the received input imagebeing applied to the first convolutional layer.

According to another quantization operation 347, quantization can beperformed of the first interim feature map. Quantization may beperformed in a number of ways. Preferably, the another quantizationoperation 347 is a type of uniform quantization described with referenceto FIGS. 10 and 11 , and is not as taxing to client device 310 as theadaptive quantization performed by server system 110. The anotherquantization operation 347 may generate a quantized first interimfeature map.

According to a second generation operation 348, a second interim featuremap may be generated. This may be performed in a number of ways, forexample by applying the quantized first interim feature map to a secondconvolutional layer, as will be explained in more detail later.

According to a recognition operation 349, recognition may be performedof the object in the input image. This recognition will be of coursefirst in terms of mathematics, and can be performed from the secondinterim feature map. Optionally, quantization of the second interimfeature map may be performed prior to the recognition operation beingperformed.

The operations of the exemplary process provided in flowchart 340 arenow described in more detail for client device embodiments that use aneural network (NN) with layer pairs such as those of FIG. 2 .

FIG. 12 is a block diagram illustrating an exemplary neural network (NN)1223 for a client device and an exemplary MLP classifier 1237 for aclient device. In this example, neural network (NN) 1223 issubstantially similar to the above-described neural network (NN) 323.Neural network (NN) 1223 and an MLP classifier 1237 may have beeninitialized with the configuration of a neural network prepared in viewof a training image, as mentioned above.

As shown in FIG. 12 , neural network (NN) 1223 receives an input image1202, and generates a recognition result 1249. The recognition result1249 indicates whether a training image is or is not within input image1202. Neural network (NN) 1223 includes at least a first layer pair 1221of a first convolutional (C1) layer 1254 and a first subsampling (S1)layer 1258. Neural network (NN) 1223 also includes a second layer pair1222 of a second convolutional (C2) layer 1264 and a second subsampling(S2) layer 1268. Layer pairs 1221, 1222 may substantially as describedabove with regard to other layer pairs.

In FIG. 12 , arrows show the effect of the operations of flowchart 340.In exemplary embodiments, input image 1202, which has been received bythe input device, is applied to first convolutional layer 1254.

Neural network (NN) 1223 can be configured to generate in firstsubsampling layer 1258 a first interim feature map, in response to inputimage 1202 being applied to first convolutional layer 1254. This firstinterim feature map could have first interim original weights.

The processor of the client device (not shown in FIG. 12 ) can beconfigured to perform quantization of the first interim feature map.This quantization is shown as operation 1246, and can be unitaryquantization or another type. The quantization may generate a quantizedfirst interim feature map. In this particular case, quantizing thusconverts the first interim original weights into first interimlower-resolution weights of the quantized first interim feature map.This can include aspects deriving both from ultimately input image 1202and the stored learned configuration weights.

The quantized first interim feature map can be applied to secondconvolutional layer 1264. NN 1223 can be configured to generate insecond subsampling layer 1268 a second interim feature map, in responseto the quantized first interim feature map being applied to secondconvolutional layer 1264. This second interim feature map could havesecond interim original weights.

MLP classifier 1237 can be configured to perform recognition of thetraining image being in the input image. This recognition can beperformed from the second interim feature map. Performing thisrecognition may generate recognition result 1249.

In addition, quantizing can take place at additional locations shown byarrows of operation 1256, 1257. In particular, input image 1202 itselfmay be quantized prior to being applied to first convolutional layer1254, as shown by the arrow of operation 1256. Moreover, the secondinterim feature map may be quantized after being generated at secondsubsampling layer 1268 and prior to the recognition operation beingperformed, as shown by the arrow of operation 1257. Again, quantizationmay be performed by the processor of the client device.

Examples of actual simulations are now described.

FIG. 13 is a group of forty (40) sample training images for handwritingrecognition (MNIST handwritten digits). The left-most column of thesetraining images may receive the classification “0” for purposes of theMLP classifier, the next column “1”, and so on for a total of 10classes.

FIG. 14 is a diagram of data structures 1401 in a sample convolutionalneural network NN used for performing simulations as per the above. FIG.14 does not show the quantization operations described above.

Data structures 1401 include a set C1 1454 of six (6) feature maps, each24×24 pixels, which have been generated by convolution of an image 1402at a 5*5 kernel. Data structures 1401 also include a set C2 1458 of six(6) feature maps, each 12×12 pixels, which have been generated bysubsampling the feature maps of set C1 at /2 (divide-by-2) scale. Datastructures 1401 additionally include a set C2 1464 of twelve (12)feature maps, each 8×8 pixels, which have been generated by convolvingwith a 5*5 kernel. Data structures 1401 further include a set C2 1468 oftwelve (12) feature maps, each 4×4 pixels, which have been generated bysubsampling the feature maps of set C1 at /2 (divide-by-2) scale. Datastructures 1401 moreover include classes 1437 of an MLP classifier,which generates a recognition result 1449.

Training was performed offline, using back propagation (BP) to learnweights. Supervised iterative quantization was used as described aboveto quantize the learned weights for lower bit resolution. Testing ofrecognition was then performed given quantization of input or featuremaps. Performance was evaluated in terms of the classification error—thesmaller the better.

The dimension of the classifier weights connecting to output neurons ismuch larger than convolutional kernel weights, and in general requiresmore bits for higher resolution. In this case the resolution bit of theclassifier was set as at a fixed value of six (6) bits. Then differentbit resolutions of convolutional kernels were evaluated with respect toperformance.

FIG. 15 is a table showing simulation results that contrast thesimulated performance of embodiments over the prior art. The columns arefor number of input resolution bits, and the rows are for the number ofweight resolution bits. Each row has three sub-rows for differentquantization approaches, the top sub-row being for uniform quantization,the middle sub-row being for k-means adaptive quantization, and thebottom sub-row.

For very low bit resolutions, of course error is very high. It will beobserved, however, that with resolutions of only four bits, the same(low) error of only 1.15% is achieved by embodiments as with theoriginal in the first and second sub-rows. In fact, an arrow points outhow the original low error table value in the top sub-row is met by ano-worse table value in a bottom sub-row for only four bits ofresolution.

FIG. 16 is a bar chart for contrasting simulated performance ofembodiments over the prior art. Bars 1610, 1620, 1643 show the averagetesting error for low bit resolution (up to 4 bits), respectively for a)uniform quantization, b) k-means adaptive quantization, and c)embodiments. Bar 1643 has the lowest error.

FIG. 17 is a bar chart for contrasting simulated performance ofembodiments over the prior art. Bar charts 1710, 1720, 1743 show theaverage testing error for all bit resolution, respectively for a)uniform quantization, b) k-means adaptive quantization, and c)embodiments. Bar chart 1743 has the lowest error.

FIG. 18 shows groups of bar charts for contrasting simulated performanceof embodiments over the prior art. Each group of three bar charts is forthe same error, shown along the horizontal axis. Within each group, a)the left-most bar is for uniform quantization, b) the middle bar is fork-means adaptive quantization, and c) the right-most bar is perembodiments. The vertical axis shows the number of total bits requiredto meet the error level (i.e., for the error level to not be higher).For all testing errors shown, the right-most bar requires the leastnumber of total bits required to meet the error level.

The above described devices and/or systems perform functions, processesand/or methods. These functions, processes and/or methods may beimplemented by one or more devices that include logic circuitry. Such adevice can be alternately called a computer, and so on. It may be astandalone device or computer, such as a general purpose computer, orpart of a device that has one or more additional functions.

Standards of performance are to be judged by a system designer,manufacturer, user or other similarly interested party. The term“substantial” as used herein generally relates to adequacy of resultingsystem performance.

The logic circuitry may include a processor that may be programmable fora general purpose, or dedicated, such as a microcontroller, amicroprocessor, a Digital Signal Processor (DSP), etc. Examples mayinclude processors 120, 320.

The logic circuitry may also include non-transitory computer-readablestorage media, such as memories. Such media can be of different typesincluding but not limited to volatile memory, non-volatile memory (NVM),read only memory (ROM); random access memory (RAM); magnetic diskstorage media; optical storage media; smart cards, flash memory devices,etc. Examples may include memories 130, 330.

These storage media, individually or in combination with others, canhave stored thereon data. Examples of data for storage in storage mediainclude data 135, 335.

In addition, these storage media may store programs that the processormay be able to read, and execute. More particularly, the programs caninclude instructions in the form of code, which the processor may beable to execute upon reading. Examples include programs 132, 332.

Executing a program is performed by physical manipulations of physicalquantities, and may result in the functions, processes, actions and/ormethods to be performed, and/or the processor to cause other devices orcomponents or blocks to perform such functions, processes, actionsand/or methods. Often, for the sake of convenience only, it is preferredto implement and describe a program as various interconnected distinctsoftware modules or features. These, along with data are individuallyand also collectively known as software. In some instances, software iscombined with hardware, in a mix called “firmware.”

Moreover, methods and algorithms are described herein. These methods andalgorithms are not necessarily inherently associated with any particularlogic device or other apparatus. Rather, the methods and algorithms maybe advantageously implemented by programs for use by a computingmachine, such as a general-purpose computer, a special purpose computer,a microprocessor, etc.

This detailed description includes flowcharts, display images,algorithms, and symbolic representations of program operations within atleast one computer readable medium. An economy is achieved in that asingle set of flowcharts is used to describe both programs, and alsomethods. So, while flowcharts describe methods in terms of boxes, theyalso concurrently describe programs.

In the methods described above, each operation can be performed as anaffirmative step of doing, or causing to happen, what is written thatcan take place. Such doing or causing to happen can be by the wholesystem or device, or just one or more components of it. In addition, theorder of operations is not constrained to what is shown, and differentorders may be possible according to different embodiments. Moreover, incertain embodiments, new operations may be added, or individualoperations may be modified or deleted. The added operations can be, forexample, from what is mentioned while primarily describing a differentsystem, apparatus, device or method.

A person skilled in the art will be able to practice the presentinvention in view of this description, which is to be taken as a whole.Details have been included to provide a thorough understanding. In otherinstances, well-known aspects have not been described, in order to notobscure unnecessarily the present invention. Plus, any reference to anyprior art in this description is not, and should not be taken as, anacknowledgement or any form of suggestion that this prior art formsparts of the common general knowledge in any country.

This description includes one or more examples, but that does not limithow the invention may be practiced. Indeed, examples or embodiments ofthe invention may be practiced according to what is described, or yetdifferently, and also in conjunction with other present or futuretechnologies. Other embodiments include combinations andsub-combinations of features described herein, including for example,embodiments that are equivalent to: providing or applying a feature in adifferent order than in a described embodiment; extracting an individualfeature from one embodiment and inserting such feature into anotherembodiment; removing one or more features from an embodiment; or bothremoving a feature from an embodiment and adding a feature extractedfrom another embodiment, while providing the features incorporated insuch combinations and sub-combinations.

In this document, the phrases “constructed to” and/or “configured to”denote one or more actual states of construction and/or configurationthat is fundamentally tied to physical characteristics of the element orfeature preceding these phrases and, as such, reach well beyond merelydescribing an intended use. Any such elements or features can beimplemented in any number of ways, as will be apparent to a personskilled in the art after reviewing the present disclosure, beyond anyexamples shown in this document.

The following claims define certain combinations and subcombinations ofelements, features and steps or operations, which are regarded as noveland non-obvious. Additional claims for other such combinations andsubcombinations may be presented in this or a related document.

What is claimed is:
 1. A device, comprising: a processor; and a memory,the processor and the memory being configured as a neural networkcomprising: at least one layer comprising an input and an output, thelayer configured to receive an input feature map at the input and outputan output feature map at the output, at least one of the input featuremap and the output feature map having been quantized by a unitaryquantizing operation to reduce a number of bits of at least one value ofthe feature map from a first predetermined number of bits to a secondpredetermined number of bits that is less than the first predeterminednumber of bits without changing a dimension of the feature map.
 2. Thedevice of claim 1, wherein the neural network further comprises at leastone interim feature map between the input and the output of the layer,the interim feature map having been quantized by the unitary quantizingoperation to reduce a number of bits of at least one value of theinterim feature map from a third predetermined number of bits to afourth predetermined number of bits that is less than the thirdpredetermined number of bits without changing a dimension of the interimfeature map corresponding.
 3. The device of claim 2, wherein the atleast one value of the interim feature map has been further quantized byone of the unitary quantizing operation or a supervised iterativequantization operation.
 4. The device of claim 1, wherein the at leastone value of the feature map has been further quantized by one of theunitary quantizing operation or a supervised iterative quantizationoperation.
 5. The device of claim 1, wherein the input feature mapcomprises an input feature map of an image.
 6. The device of claim 1,wherein the neural network comprises a convolutional neural network. 7.The device of claim 1, wherein the device comprises a smartphone, atablet computer, a portable electronic device, a computer or a server.8. The device of claim 1, wherein the neural network is configured toperform object recognition.
 9. A device, comprising: a processor; and amemory, the processor and the memory being configured as a neuralnetwork comprising: at least one layer comprising an input and anoutput, the layer configured to receive an input feature map at theinput and output an output feature map at the output, at least one ofthe input feature map and the output feature map having been quantizedby a supervised iterative quantization operation to reduce a number ofbits of at least one value of the feature map from a first predeterminednumber of bits to a second predetermined number of bits that is lessthan the first predetermined number of bits without changing a dimensionof the feature map.
 10. The device of claim 9, wherein the neuralnetwork further comprises at least one interim feature map between theinput and the output of the layer, the interim feature map having beenquantized by the supervised iterative quantization operation to reduce anumber of bits of at least one value of the interim feature map from athird predetermined number of bits to a fourth predetermined number ofbits that is less than the third predetermined number of bits withoutchanging a dimension of the interim feature map.
 11. The device of claim10, wherein the at least one value of the interim feature map has beenfurther quantized by one of a unitary quantizing operation or thesupervised iterative quantization operation.
 12. The device of claim 9,wherein the at least one value of the feature map has been furtherquantized by one of a unitary quantizing operation or the supervisediterative quantization operation.
 13. The device of claim 9, wherein theinput feature map comprises an input feature map of an image.
 14. Thedevice of claim 9, wherein the neural network comprises a convolutionalneural network.
 15. The device of claim 9, wherein the neural network isconfigured to perform object recognition.
 16. The device of claim 9,wherein the device comprises a smartphone, a tablet computer, a portableelectronic device, a computer or a server.
 17. A device, comprising: aprocessor; and a memory, the processor and the memory being configuredas a neural network comprising: at least one first layer comprising aninput and an output, the first layer configured to receive an inputfeature map at the input and output an output feature map at the output,the neural network further comprising at least one interim feature mapbetween the input and the output of the first layer, the interim featuremap having been quantized by a unitary quantizing operation or asupervised iterative quantization operation to reduce a number of bitsof at least one value of the interim feature map from a firstpredetermined number of bits to a second predetermined number of bitsthat is less than the first predetermined number of bits withoutchanging a dimension of the interim feature map.
 18. The device of claim17, wherein the neural network further comprises at least one secondlayer comprising an input and an output, the second layer configured toreceive an input feature map at the input and output an output featuremap at the output, at least one of the input feature map and the outputfeature map having been quantized by the unitary quantizing operation orthe supervised iterative quantization operation to reduce a number ofbits of at least one value of the feature map from a third predeterminednumber of bits to a fourth predetermined number of bits that is lessthan the third predetermined number of bits without changing a dimensionof the feature map.
 19. The device of claim 17, wherein the inputfeature map comprises an input feature map of an image.
 20. The deviceof claim 17, wherein the device comprises a smartphone, a tabletcomputer, a portable electronic device, a computer or a server.